home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Component;
- import java.awt.Point;
- import java.awt.event.InputEvent;
- import java.awt.event.MouseEvent;
- import javax.swing.SwingUtilities;
- import javax.swing.event.MouseInputListener;
- import javax.swing.table.TableCellEditor;
-
- public class BasicTableUI$MouseInputHandler implements MouseInputListener {
- // $FF: synthetic field
- private final BasicTableUI this$0;
- private Component dispatchComponent;
-
- public BasicTableUI$MouseInputHandler(BasicTableUI var1) {
- this.this$0 = var1;
- }
-
- public void mouseClicked(MouseEvent var1) {
- }
-
- public void mouseDragged(MouseEvent var1) {
- if (SwingUtilities.isLeftMouseButton(var1)) {
- this.repostEvent(var1);
- TableCellEditor var2 = this.this$0.table.getCellEditor();
- if (var2 == null || var2.shouldSelectCell(var1)) {
- Point var3 = var1.getPoint();
- int var4 = this.this$0.table.rowAtPoint(var3);
- int var5 = this.this$0.table.columnAtPoint(var3);
- if (var5 == -1 || var4 == -1) {
- return;
- }
-
- BasicTableUI.access$0(this.this$0.table, var4, var5, false, true);
- }
-
- }
- }
-
- public void mouseEntered(MouseEvent var1) {
- }
-
- public void mouseExited(MouseEvent var1) {
- }
-
- public void mouseMoved(MouseEvent var1) {
- }
-
- public void mousePressed(MouseEvent var1) {
- if (SwingUtilities.isLeftMouseButton(var1)) {
- Point var2 = var1.getPoint();
- int var3 = this.this$0.table.rowAtPoint(var2);
- int var4 = this.this$0.table.columnAtPoint(var2);
- if (var4 != -1 && var3 != -1) {
- if (this.this$0.table.editCellAt(var3, var4, var1)) {
- this.setDispatchComponent(var1);
- this.repostEvent(var1);
- } else {
- this.this$0.table.requestFocus();
- }
-
- TableCellEditor var5 = this.this$0.table.getCellEditor();
- if (var5 == null || var5.shouldSelectCell(var1)) {
- this.setValueIsAdjusting(true);
- BasicTableUI.access$0(this.this$0.table, var3, var4, ((InputEvent)var1).isControlDown(), ((InputEvent)var1).isShiftDown());
- }
-
- }
- }
- }
-
- public void mouseReleased(MouseEvent var1) {
- if (SwingUtilities.isLeftMouseButton(var1)) {
- this.repostEvent(var1);
- this.dispatchComponent = null;
- this.setValueIsAdjusting(false);
- }
- }
-
- private boolean repostEvent(MouseEvent var1) {
- if (this.dispatchComponent == null) {
- return false;
- } else {
- MouseEvent var2 = SwingUtilities.convertMouseEvent(this.this$0.table, var1, this.dispatchComponent);
- this.dispatchComponent.dispatchEvent(var2);
- return true;
- }
- }
-
- private void setDispatchComponent(MouseEvent var1) {
- Component var2 = this.this$0.table.getEditorComponent();
- Point var3 = var1.getPoint();
- Point var4 = SwingUtilities.convertPoint(this.this$0.table, var3, var2);
- this.dispatchComponent = SwingUtilities.getDeepestComponentAt(var2, var4.x, var4.y);
- }
-
- private void setValueIsAdjusting(boolean var1) {
- this.this$0.table.getSelectionModel().setValueIsAdjusting(var1);
- this.this$0.table.getColumnModel().getSelectionModel().setValueIsAdjusting(var1);
- }
- }
-